﻿<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=9">
    <link rel="icon" href="~/Content/images/favicon.ico" type="image/x-icon">
    <link rel="shortcut icon" href="~/Content/images/favicon.ico" type="image/x-icon">

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">

    <meta name="description" content="" /> 
    <meta name="author" content="" /> 
    
    <link href="/content/bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="/content/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">

    <link href="/content/bootstrap/css/docs.css" rel="stylesheet">
    <link href="/content/bootstrap/css/datepicker.css" rel="stylesheet">
    
    <script src="/scripts/jquery-1.8.3.min.js"></script>

    <script src="/scripts/underscore.js"></script>
    <script src="/scripts/backbone.js"></script>

    <script src="/content/bootstrap/js/bootstrap.js"></script>
    <script src="/content/bootstrap/js/bootstrap-datepicker.js"></script>

    <script src="/scripts/jquery.tablesorter.min.js"></script>
    <link href="/content/tablesorter/blue/style.css"" rel="stylesheet">
    
    <script src="/scripts/office.js"></script>
    <script src="/scripts/app.js"></script>
    
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements --> 
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]--> 

    <style type="text/css">
        .modal
        {
            width: 1000px;
            margin: -280px 0 0 -500px;
        }

        select.input-xlarge
        {
            width: 284px;
        }

        .profile-alert  { font-size:0.6em; font-weight: bold; display: inline-block; vertical-align: top; color: #f00; }
        table tr td  { cursor: pointer; }

    </style>

    <script type="text/javascript">
        $(function () {

            $.ajaxSetup({
                cache: false
            });

            $(".btn[data-action='account-name']").live("click", function () {
                $('.modal[data-name="LOGIN"]').modal("show");
            });

            
            $(".date").live("mouseenter", function () {
                $(".date").datepicker();
            });
        });
    </script>

    <title>@ViewBag.Title</title>
</head>

<body class="preview" data-spy="scroll" data-target=".subnav" data-offset="50">

    <div class="navbar navbar-fixed-top navbar-inverse">
      <div class="navbar-inner">
        <div class="container">
            
            <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>
            
            <a class="brand" href="/">1EDEX</a>
                                                                        
            <div class="btn-group pull-right">

                @if (Session["api_key"] != null)
                {
                    <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="icon-user"></i><span id="account-name">@(Session["company_name"])</span> <span class="caret"></span>
                    </a>
                
                    <ul id="allow-companies" class="dropdown-menu">
                        <li><a href="/security/ChangeCompany/">Смена компании</a></li>
                        <li><a href="/security/Profile/">Профиль</a></li>
                        <li class="divider"></li>
                        <li><a href="/security/SingOut/">Выход</a></li>
                    </ul>
                }
                else
                {
                    <a class="btn" data-action="account-name" href="/security/SingIn/"><i class="icon-user"></i>Авторизация</a>
                }


            </div>
            
            <div class="nav-collapse">

                @if (Session["api_key"] != null)
                {                                   
                <ul class="nav">    
                    
                    @if (Session["company_name"] != null)
                    {  
                            
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Документы <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="/document/upload/">Загрузить файл CommerceML</a></li>
                            <li><a href="/document/incoming/">Входящие накладные</a></li>
                            <li><a href="/document/outgoing/">Исходящие накладные</a></li>
                        </ul>
                    </li>
                
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Справочники <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="/company/">Компании</a></li>
                            <li><a href="/supplier/">Контрагенты</a></li>
                            <li><a href="/location/">Склады</a></li>
                            <li><a href="/Item/">Товары</a></li>
                            <!--
                            <li class="divider"></li>
                            <li><a href="/companyrecode/">Соответствие кодов компаний</a></li>
                            <li><a href="/locationrecode/">Соответствие кодов объектов</a></li>
                            <li><a href="/productrecode/">Товары (ожидают соответствия)</a></li>
                            -->
                        </ul>
                    </li>

                    }

                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Управление доступами <b class="caret"></b></a>
                        <ul class="dropdown-menu">
                            <li><a href="/usercompany/">Мои компании</a></li>
                            <li class="divider"></li>
                            <li><a href="/CompanyAccess/UseAccessCode/">Запросить доступ</a></li>
                            <li><a href="/CompanyAccess/">Разрешения</a></li>
                            <li><a href="/usercompany/AccessToUser/">Предоставить доступ</a></li>
                            <li class="divider"></li>
                            <li><a href="#">Запросы <span class="profile-alert">(2)</span></a></li>
                        </ul>
                    </li>

                </ul>
                }
            </div>            
        </div>          
      </div>
    </div>

    <div class="container">
        @RenderBody()
    </div>

    <div class="footer">
        <div class="container">
            <table style="width:100%">
                <tr>
                    <td style="text-align:left">
                        Есть идеи? <a href="mailto:feedback@1edex.com">feedback@1edex.com</a>
                    </td>                    
                    <td style="text-align:center">
                        <a href="/">smart fast reliable</a>                          
                    </td>
                    <td style="text-align:right">
                        Служба поддержки <a href="mailto:support@1edex.com">support@1edex.com</a>
                    </td>
                </tr>
            </table>                        
        </div>
    </div>

    
</body>
</html>
